<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script>
        var index = 0;
        var images = ["4bed2e738bd4b31ccda81d7a8bd6277f9f2ff85f.jpg", "95eef01f3a292df57f4575cab0315c6035a8736f.jpg"]
        function changeImage() {
            // 获取image对应的dom
            document.getElementById("image").src = images[index % 2]
            index ++;
        }
        // 定时器
        setInterval(changeImage, 2000)
    </script>
</head>
<body>
<img src="4bed2e738bd4b31ccda81d7a8bd6277f9f2ff85f.jpg" id="image" />
</body>
</html>